﻿/*
 * Created by SharpDevelop.
 * User: Usuario
 * Date: 27/11/2011
 * Time: 05:02 a.m.
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Drawing;
using System.Windows.Forms;
using PetSoft.GUI.Ventas;
using Business_Logic;

namespace PetSoft.GUI.Ventas
{
	/// <summary>
	/// Description of GUIMenuVentas.
	/// </summary>
	public partial class GUIMenuVentas : Form
	{
		public GUIMenuVentas()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			
			BLPrivilegio blpriv = new BLPrivilegio();
            
            //this.administraciónToolStripMenuItem.Enabled = false;
            
           	if (!blpriv.existeVentana("VENT","CLMA",BLInfo.usuarioActual.Rol.Privilegio))
            		this.mCliBTN.Enabled = false;
           	if (!blpriv.existeVentana("VENT","PEDV",BLInfo.usuarioActual.Rol.Privilegio))
            		this.mVentBTN.Enabled = false;
           	if (!blpriv.existeVentana("VENT","FLUC",BLInfo.usuarioActual.Rol.Privilegio))
            		this.cajaBTN.Enabled = false;
           	if (!blpriv.existeVentana("VENT","DESC",BLInfo.usuarioActual.Rol.Privilegio))
            		this.descBTN.Enabled = false;
           	if (!blpriv.existeVentana("VENT","REPV",BLInfo.usuarioActual.Rol.Privilegio))
            		this.repVBTN.Enabled = false;
           	
			
			//
			// TODO: Add constructor code after the InitializeComponent() call.
			//
		}
		
		void SalirBTNClick(object sender, EventArgs e)
		{
			this.Close();
		}
		
		void MCliBTNClick(object sender, EventArgs e)
		{			
			GUIMantenimientoCliente vCli = new GUIMantenimientoCliente(false);
			vCli.ShowDialog();
		}
		
		void MVentBTNClick(object sender, EventArgs e)
		{
			GUIBuscarPedidoVenta vVenta = new GUIBuscarPedidoVenta();
			vVenta.ShowDialog();
		}
		
		void CajaBTNClick(object sender, EventArgs e)
		{
			GUIMantenimientoCaja vCaja = new GUIMantenimientoCaja();
			vCaja.ShowDialog();
		}
		
		void DescBTNClick(object sender, EventArgs e)
		{
			GUIBuscarDescuentoProducto vDesc = new GUIBuscarDescuentoProducto();
			vDesc.ShowDialog();
		}
		
		void RepVBTNClick(object sender, EventArgs e)
		{
			GUIReporteVentas vRep = new GUIReporteVentas();
			vRep.ShowDialog();
		}
	}
}
